#include "Camera.h"


Camera::Camera(ISceneManager* smgr, ISceneNode* table) : distance(120.f)
{
	//distance = 120.f;

	node = smgr->addCameraSceneNode();
	//node = smgr->addCameraSceneNodeFPS();

	if (node)
	{
		node->setParent(table);
		node->setTarget(vector3df(0.f, Table::SIZE.Y-10, 0.f));
		rotateToDegree(table->getRotation().Y + 45);
	}
}


void Camera::rotateToDegree(f32 degree)
{
	node->setPosition(node->getPosition() + vector3df(
		distance * sin(degree * DEGTORAD), Table::SIZE.Y+150/*50*/, distance * cos(degree * DEGTORAD)));
}


Camera::~Camera(void)
{
}
